﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Timetable.Base.Entities;
using Ninject;
using Timetable.Base.Interfaces.Validators;
using Timetable.Base.Interfaces.Repositories;

namespace Timetable.Data.Services.DataServices
{
    public class DepartmentService: BaseDataService<Department>
    {
        IRepository<Department> _repository;

        IValidator<Department> _validator;

        [Inject]
        public DepartmentService(IRepository<Department> repository, IValidator<Department> validator)
        {
            _repository = repository;
            _validator = validator;
        }

        public override IRepository<Department> Repository
        {
            get { return _repository; }
        }

        public override IValidator<Department> Validator
        {
            get { return _validator; }
        }

        public override IQueryable<Department> All()
        {
            return _repository.Get();
        }

        public override Department GetById(int id)
        {
            return _repository.GetById(id);
        }
    }
}
